// 看到此报错，是因为没有配置vue.config.js的【transpileDependencies】，详见：https://www.uviewui.com/components/npmSetting.html#_5-cli模式额外配置
const pleaseSetTranspileDependencies = {},
	babelTest = pleaseSetTranspileDependencies?.test

// 配置信息
import config from './libs/config/config.js'
// props配置信息
import props from './libs/config/props.js'

import mixin from './libs/mixin/mixin.js'
import mpMixin from './libs/mixin/mpMixin.js'

// 各个需要fixed的地方的z-index配置文件
import zIndex from './libs/config/zIndex.js'

// 颜色渐变相关,colorGradient-颜色渐变,hexToRgb-十六进制颜色转rgb颜色,rgbToHex-rgb转十六进制
import colorGradient from './libs/function/colorGradient.js'

// 规则检验
import test from './libs/function/test.js'
// 防抖方法
import debounce from './libs/function/debounce.js'
// 节流方法
import throttle from './libs/function/throttle.js'
// 公共文件写入的方法
import index from './libs/function/index.js'


const $u = {
	config, // uView配置信息相关，比如版本号
	props,
	mixin,
	mpMixin,
	colorGradient: colorGradient.colorGradient,
	hexToRgb: colorGradient.hexToRgb,
	rgbToHex: colorGradient.rgbToHex,
	colorToRgba: colorGradient.colorToRgba,
	test,
	zIndex,
	debounce,
	throttle,
	...index,
}

// $u挂载到uni对象上
uni.$u = $u

const install = (Vue) => {
	Vue.config.globalProperties.$u = $u
	Vue.config.globalProperties.$nextTick = (cb) => {
		cb();
	}
}

export default {
	install
}